import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import dataV from '@jiaminghi/data-view';
Vue.use(dataV);

// 按需引入vue-awesome图标
import Icon from 'vue-awesome/components/Icon';
import 'vue-awesome/icons/chart-bar.js';
import 'vue-awesome/icons/chart-area.js';
import 'vue-awesome/icons/chart-pie.js';
import 'vue-awesome/icons/chart-line.js';
import 'vue-awesome/icons/align-left.js';

// 全局注册图标
Vue.component('icon', Icon);

// 适配flex
import '@/common/flexible.js';

Vue.prototype.refontSize = function (res){
    // let docEl = document.documentElement,
    let clientWidth = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
    if (!clientWidth) return;
    let fontSize = (clientWidth / 1920);
    return res*fontSize;
}

Vue.prototype.backfontSize = function (res){
    // let docEl = document.documentElement,
    let clientWidth = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
    if (!clientWidth) return;
    let fontSize = (1920 / clientWidth);
    return res*fontSize;
}
// 引入全局css
import './assets/scss/style.scss';

//引入全局变量
import global from './utils/global.js' //注意文件路径，实际路径以项目目录结构为准
Vue.prototype.$global = global;

//引入echart
import echarts from 'echarts'
Vue.prototype.$echarts = echarts

Vue.config.productionTip = false;

new Vue({
    router,
    store,
    render: (h) => h(App),
}).$mount('#app');

//引入词云

//前后端数据请求
import axios from 'axios';
//把方法放到vue的原型上，这样就可以全局使用了
Vue.prototype.$http = axios.create({
    //设置20秒超时时间
    timeout: 20000,
    baseURL: global.host, //这里写后端地址

});

//引入highcharts
import highcharts from 'highcharts'
import highcharts3d from 'highcharts/highcharts-3d'

highcharts3d(highcharts)

//引入vue-easytable
import "vue-easytable/libs/theme-default/index.css"; // 引入样式
import { VeTable, VePagination, VeIcon, VeLoading, VeLocale } from "vue-easytable";

Vue.use(VeTable);
Vue.use(VePagination);
Vue.use(VeIcon);
Vue.use(VeLoading);

Vue.prototype.$veLoading = VeLoading;
Vue.prototype.$veLocale = VeLocale;